<h3><%= @instance.event.formatted_date %> :: <%= @instance.event.event_type.name %> :: <%= @instance.instance_type.name %>
</h3>

<div id="name">
	<%= link_to "#{@instance.event.event_type.name} Global Stats", :controller => 'events', :action => 'stats', :id => @instance.event.id %>
</div>
<br>

<table class="report-summary">
	<tr>
		<th>Meeting</th>
		<th>Participants</th>
		<th>Leaders</th>
		<th>Total</th>
	</tr>
	
	<% @instance.meetings.each do |meeting| %>
	
	<tr>
		<td><%= link_to "#{meeting.group.name}", :controller => 'meetings', :action => 'detail', :id => meeting.id %></td>
		<td><%= meeting.participant_attendances.count %></td>
		<td><%= meeting.staff_attendances.count %></td>
		<td><%= meeting.attendances.count %></td>
	</tr>
	<% end %>
</table>

<br>

<table class="report-sub-summary">
	<tr>
		<th>Total Participants</th>
		<th>Total Leaders</th>
		<th>Total Present</th>
	</tr>

	<tr>
		<td><%= @instance.participant_attendances.count %></td>
		<td><%= @instance.staff_attendances.count %></td>
		<td><%= @instance.attendances.count %></td>
	</tr>

</table>